Imports StartPoint.BR.Interfaces
Imports StartFrame.BR.Interfaces

Namespace Compras.Listados

Public Class DeudasEsp
        Inherits StartFrame.US.Listador

        Dim _Facturas As IConsultaFacturasC

#Region " Windows Form Designer generated code "

        Public Sub New()
            MyBase.New()

            'This call is required by the Windows Form Designer.
            InitializeComponent()

            'Add any initialization after the InitializeComponent() call

        End Sub

        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        Friend WithEvents fe_devengamiento As LnkDesdeHastaFecha
        Friend WithEvents cd_proveedor As LnkDesdeHastaFK
        Friend WithEvents im_total As LnkControls.LnkSpinner
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(DeudasEsp))
            Me.fe_devengamiento = New LnkDesdeHastaFecha
            Me.cd_proveedor = New LnkDesdeHastaFK
            Me.im_total = New LnkControls.LnkSpinner
            Me.Contenedor.SuspendLayout()
            CType(Me.lnk_dataSet, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.im_total, System.ComponentModel.ISupportInitialize).BeginInit()
            '
            'StatusBar1
            '


            'Me.StatusBar1.Size = New System.Drawing.Size(546, 22)
            '
            'TabPage1
            '
            Me.TabPage1.Name = "TabPage1"
            Me.TabPage1.Size = New System.Drawing.Size(463, 311)
            '
            'Contenedor
            '
            Me.Contenedor.Controls.Add(Me.im_total)
            Me.Contenedor.Controls.Add(Me.cd_proveedor)
            Me.Contenedor.Controls.Add(Me.fe_devengamiento)
            Me.Contenedor.Location = New System.Drawing.Point(0, 64)
            Me.Contenedor.Name = "Contenedor"
            Me.Contenedor.Size = New System.Drawing.Size(477, 232)
            '
            'cboReporte
            '
            Me.cboReporte.Location = New System.Drawing.Point(127, 43)
            Me.cboReporte.Name = "cboReporte"
            Me.cboReporte.Size = New System.Drawing.Size(309, 21)
            Me.cboReporte.ValueMember = "ID"
            '
            'lblReporte
            '
            Me.lblReporte.Location = New System.Drawing.Point(7, 46)
            Me.lblReporte.Name = "lblReporte"
            Me.lblReporte.Size = New System.Drawing.Size(104, 15)
            '
            'lblTitulo
            '
            Me.lblTitulo.Name = "lblTitulo"
            Me.lblTitulo.Text = "Deudas Especiales"
            '
            'cmdMinimizar
            '
            Me.cmdMinimizar.Image = CType(resources.GetObject("cmdMinimizar.Image"), System.Drawing.Image)
            Me.cmdMinimizar.Location = New System.Drawing.Point(472, 0)
            Me.cmdMinimizar.Name = "cmdMinimizar"
            '
            'fe_devengamiento
            '
            Me.fe_devengamiento.BackColor = System.Drawing.SystemColors.ControlLight
            Me.fe_devengamiento.Desde = New Date(2000, 1, 1, 0, 0, 0, 0)
            Me.fe_devengamiento.Hasta = New Date(2003, 11, 11, 0, 0, 0, 0)
            Me.fe_devengamiento.Location = New System.Drawing.Point(152, 32)
            Me.fe_devengamiento.Name = "fe_devengamiento"
            Me.fe_devengamiento.Size = New System.Drawing.Size(176, 20)
            Me.fe_devengamiento.TabIndex = 11
            '
            'cd_proveedor
            '
            Me.cd_proveedor.BackColor = System.Drawing.SystemColors.ControlLight
            Me.cd_proveedor.Desde = ""
            Me.cd_proveedor.Hasta = "zzzzzzzzzz"
            Me.cd_proveedor.Location = New System.Drawing.Point(152, 64)
            Me.cd_proveedor.LvCampo = "cd_proveedor"
            Me.cd_proveedor.LvTabla = "kad_proveedores"
            Me.cd_proveedor.LvWhere = Nothing
            Me.cd_proveedor.Name = "cd_proveedor"
            Me.cd_proveedor.Size = New System.Drawing.Size(296, 20)
            Me.cd_proveedor.TabIndex = 12
            Me.cd_proveedor.Valida = False
            '
            'im_total
            '
            Me.im_total.Location = New System.Drawing.Point(152, 96)
            Me.im_total.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0})
            Me.im_total.Name = "im_total"
            Me.im_total.Size = New System.Drawing.Size(144, 20)
            Me.im_total.TabIndex = 13
            Me.im_total.Value = New Decimal(New Integer() {1000, 0, 0, 0})
            '
            'DeudasEsp
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
            Me.ClientSize = New System.Drawing.Size(546, 391)
            Me.Name = "DeudasEsp"
            Me.Text = "KLdeudasesp"
            Me.Contenedor.ResumeLayout(False)
            CType(Me.lnk_dataSet, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.im_total, System.ComponentModel.ISupportInitialize).EndInit()

        End Sub

#End Region

        Private Sub KLdeudasesp_OnLoadForm(ByRef reportCollection As StartFrame.US.Listador.Reports) Handles MyBase.OnLoadForm
            Try
                'Establece las fechas parametros por defecto
                Dim fecha As ISql = CType(RemotingHelper.getObject(GetType(ISql)), ISql)

                fe_devengamiento.Hasta = fecha.GetDate(ISql.Formato.Fecha)
                'MPM 21-06-2005
                fe_devengamiento.Desde = fecha.GetDate(ISql.Formato.Fecha)

                'Asigna los reportes
                Dim rpt1 As Report

                'Rangos para el reporte Pagos por proveedor
                'rpt = New Report(1, "NombreReporte", "Titulo del combo", "Stored proc", "Assembly")   
                '"Assembly" = --> "US.spmc.compras.reportes" para este modulo
                Dim rangoFe_Devengamiento As New Rango(1, "fe_devengamiento", fe_devengamiento)
                Dim rangoProveedor As New Rango(2, "cd_proveedor", cd_proveedor)
                Dim rangoImporte As New Rango(3, "im_total", im_total)

                rpt1 = New Report(1, "KLdeudasesp_pagodeudas", "Deudas y Medios de Pago", "kldeudasesp_pagodeudas", "US.spmc.compras.reportes")
                rpt1.Rangos.Add(rangoFe_Devengamiento)
                rpt1.Rangos.Add(rangoProveedor)
                rpt1.Rangos.Add(rangoImporte)

                reportCollection.Add(rpt1)

                'Referencia el objeto de negocios relacionado
                _Facturas = CType(RemotingHelper.getObject(GetType(IConsultaFacturasC)), IConsultaFacturasC)
                Me.ObjetoReglasNegocio = _Facturas

            Catch ex As Exception
                StartFrame.US.Display.ShowError(ex.Message)
            End Try
        End Sub

    End Class

End Namespace